include( "scoreboard/scoreboard.lua" )

local lScoreBoard = nil


/*---------------------------------------------------------
   Name: gamemode:CreateScoreboard( )
   Desc: Creates/Recreates the scoreboard
---------------------------------------------------------*/
function GM:CreateScoreboard()

    if ( lScoreBoard ) then
    
        lScoreBoard:Remove()
        lScoreBoard = nil
    
    end

    lScoreBoard = vgui.Create( "ScoreBoard" )

end

/*---------------------------------------------------------
   Name: gamemode:ScoreboardShow( )
   Desc: Sets the scoreboard to visible
---------------------------------------------------------*/
function GM:ScoreboardShow()

    GAMEMODE.ShowScoreboard = true
    gui.EnableScreenClicker( true )
    
    if ( !lScoreBoard ) then
        self:CreateScoreboard()
    end
    
	lScoreBoard:SetVisible( true )
    lScoreBoard:UpdateScoreboard( true )
    
end

/*---------------------------------------------------------
   Name: gamemode:ScoreboardHide( )
   Desc: Hides the scoreboard
---------------------------------------------------------*/
function GM:ScoreboardHide()

    GAMEMODE.ShowScoreboard = false
    gui.EnableScreenClicker( false )
    
    if ( lScoreBoard ) then lScoreBoard:SetVisible( false ) end
    
end
